package com.qfjy.controller;

import com.qfjy.comon.utils.result.ResultCode;
import com.qfjy.comon.utils.result.ResultJson;
import com.qfjy.entity.po.MeetingPub;
import com.qfjy.service.MeetingPubService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @ClassName MeetingPubController
 * @Description TODO
 * @Author guoweixin
 * @Date 2022/10/18
 * @Version 1.0
 */
@Controller
@RequestMapping("meeting")
@Slf4j
public class MeetingPubController {


    @Autowired
    private MeetingPubService meetingPubService;

    /**
     * 根据会议编号查找会议详情
     * url: /meeting/selectMeetingPub?pcode=11100111
     * @param pcode
     * @return
     */
    @ResponseBody
    @GetMapping("selectMeetingPub")
    public Object selectMeetingPubByPcode(@RequestParam("pcode") String pcode){

       MeetingPub meetingPub= meetingPubService.selectMeetingPubByPcode(pcode);

       if(meetingPub==null){
           return new ResultJson<>(null, ResultCode.NOT_DATA);
       }

        return new ResultJson<>(meetingPub,ResultCode.SUCCESS);
    }
}

